import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '上班打卡时间 - 早班',
    align:"center",
    dataIndex: 'earlyStartTime'
   },
   {
    title: '下班打卡时间 - 早班',
    align:"center",
    dataIndex: 'earlyEndTime'
   },
   {
    title: '上班打卡时间 - 晚班',
    align:"center",
    dataIndex: 'lateStartTime'
   },
   {
    title: '下班打卡时间 - 晚班',
    align:"center",
    dataIndex: 'lateEndTime'
   },
   {
    title: '会议前打卡时间',
    align:"center",
    dataIndex: 'meetingStartTime'
   },
   {
    title: '会议后打卡时间',
    align:"center",
    dataIndex: 'meetingEndTime'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '上班打卡时间 - 早班',
    field: 'earlyStartTime',
    component: 'TimePicker',
    componentProps: {
      valueFormat: 'HH:mm:ss'
    },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入上班打卡时间 - 早班!'},
          ];
     },
  },
  {
    label: '下班打卡时间 - 早班',
    field: 'earlyEndTime',
    component: 'TimePicker',
    componentProps: {
      valueFormat: 'HH:mm:ss'
    },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入下班打卡时间 - 早班!'},
          ];
     },
  },
  {
    label: '上班打卡时间 - 晚班',
    field: 'lateStartTime',
    component: 'TimePicker',
    componentProps: {
      valueFormat: 'HH:mm:ss'
    },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入上班打卡时间 - 晚班!'},
          ];
     },
  },
  {
    label: '下班打卡时间 - 晚班',
    field: 'lateEndTime',
    component: 'TimePicker',
    componentProps: {
      valueFormat: 'HH:mm:ss'
    },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入下班打卡时间 - 晚班!'},
          ];
     },
  },
  {
    label: '会议前打卡时间',
    field: 'meetingStartTime',
    component: 'TimePicker',
    componentProps: {
      valueFormat: 'HH:mm:ss'
    },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入会议前打卡时间!'},
          ];
     },
  },
  {
    label: '会议后打卡时间',
    field: 'meetingEndTime',
    component: 'TimePicker',
    componentProps: {
      valueFormat: 'HH:mm:ss'
    },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入会议后打卡时间!'},
          ];
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  earlyStartTime: {title: '上班打卡时间 - 早班',order: 0,view: 'time', type: 'string',},
  earlyEndTime: {title: '下班打卡时间 - 早班',order: 1,view: 'time', type: 'string',},
  lateStartTime: {title: '上班打卡时间 - 晚班',order: 2,view: 'time', type: 'string',},
  lateEndTime: {title: '下班打卡时间 - 晚班',order: 3,view: 'time', type: 'string',},
  meetingStartTime: {title: '会议前打卡时间',order: 4,view: 'time', type: 'string',},
  meetingEndTime: {title: '会议后打卡时间',order: 5,view: 'time', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}